package com.power.using.mydaggerp.presenter.detail;

import android.support.annotation.NonNull;

import com.power.using.mydaggerp.contract.detail.GankIoDetailContract;
import com.power.using.mydaggerp.model.detail.GankIoDetailModel;

/**
 * Created by 聪明一只哈 on 2019/10/16.
 * Time: 2019/10/16  11:41
 */
public class GankIoDetailPresenter extends GankIoDetailContract.GankIoDetailPresenter{

    @NonNull
    public static GankIoDetailPresenter newInstance() {
        return new GankIoDetailPresenter();
    }



    @Override
    protected GankIoDetailContract.IGankIoDetailModel getModel() {
        return GankIoDetailModel.newInstance();
    }

    @Override
    public void onStart() {

    }

    @Override
    public void loadGankIoDetail(String url) {

        if(mIView==null){
            return;
        }

        try {
            mIView.showGankIoDetail(url);
        }catch (Exception e){
            mIView.showNetworkError();
            e.printStackTrace();
        }

    }
}
